<!DOCTYPE html>
<html>
  <head>
    <title>编辑单号</title>
	<include file='public/head'>
	<style>
		.layui-legend-size{font-size:14px !important;}
		.layui-nopadding{padding:0 !important;}
		.layui-overflow{overflow:auto;}
		.layui-nomargin{margin: 0 !important;}
		.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}
		.layui-input{height:30px !important; }
		.layui-form-search-item .layui-inline{margin-bottom: 5px;} 
		.layui-form-search-item label{margin-left: 15px;}
		.layui-table-page {padding: 7px 0px 0px;}
		.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}
	</style>
</head>
<body>

<div class="layui-tab">
  <form class="layui-form" id="f" method="post" >

    <input type="hidden" name="id" value="{$data.id}">
    <table class="layui-table layui-nomargin" style="text-align: center;margin-top:20px">
      <tr>
        <td>快递公司编号</td>
        <td>
          <select type="text" name="code" autocomplete="off" placeholder="选择物流公司"  lay-verify="required" class="layui-select" lay-search>
            <volist name="logistics" id="vo">
            <option value="{$vo.code}" <eq name="$vo.code" value="$data.code">selected</eq> >{$vo.company}</option>
            </volist>
          </select>
        </td>
      </tr>
      <tr>
        <td>物流单号</td>
        <td>
          <input type="text" name="logistics_code"  class="layui-input" required="" value="{$data.logistics_code}">
        </td>
      </tr>
      <tr>
        <td>订单编号</td>
        <td>
          <input type="text" name="order_num"  class="layui-input" required="" value="{$data.order_num ? $data.order_num : ''}">
        </td>
      </tr>
      <tr>
        <td>状态</td>
        <td>
          <select name="status" lay-verify="" class="layui-input">
            <option value="1" <eq name="data.status" value="1">selected</eq> >未使用</option>
            <option value="2" <eq name="data.status" value="2">selected</eq> >已使用</option>
          </select>   
        </td>
      </tr>
    </table>
  
  </form>
</div>
</body>

<include file="public/scripts"/>
<script>
  
  var tijiao = function(){

  var dara = $("#f").serialize();

  $.ajax({
    url:"{:cmf_plugin_url('logistics://logistics_order/editLogisticsOrder')}",
    data:dara,
    type:'post',
    success:function(data){
      if (data.code == 200) {
        layer.msg(data.message,{icon:1,time:1500},function(){
          parent.layer.closeAll();
          parent.location.reload(); 
        });
      } else {
        layer.msg(data.message,{icon:2,time:1500});
      }
    },
    error:function()
    {
      layer.msg('系统错误',{icon:2,time:1500});
    }
  })
  }
</script>
</html>